
let num = 0;
function Test(fn){
    this.num = 1;
    this.getNum=function(){
        console.log(this.num);
    }
    this.init=(fn)=>{
        fn()
    }

}



const test = new Test()
test.init(function(){
    console.log(this.getNum);  //undefined
    console.log(test.getNum); // [Function]
    console.log(this.num)  // undefined
})

const test2 = new Test()
test2.init(function(){
    Test.call(this)
    console.log(this.getNum);  // [Function]
    console.log(test2.getNum); // [Function]
    console.log(this.num)  // 1
})